﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GMS.Client.Core
{
    /// <summary>
    /// 标签类
    /// </summary>
    public class Label : CustomControl
    {
        public Label(IntPtr parentHandle, string className, string titleName, CustomControlNameType customControlNameType) : base(parentHandle, className, titleName, customControlNameType) { }

        public Label(IntPtr handle, CustomControlNameType customControlNameType) : base(handle, customControlNameType) { }

        /// <summary>
        /// 获取标签的值
        /// </summary>
        /// <returns></returns>
        public string GetValue()
        {
            var bufferLength = 1024;
            var stringBuilderbuffer = new StringBuilder(bufferLength);
            Win32API.SendMessage_GetValue(base.Handle, (int)WindowsMessageType.WM_GETTEXT, bufferLength, stringBuilderbuffer);
            return stringBuilderbuffer.ToString();
        }
    }
}
